<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>定位</title>
</head>
<style>
    body{
        margin: 20px;
    }
    .relative{
        position: relative;
        width: 400px;
        height: 200px;
        border: 1px solid #ccc;

        top: 20px;
        left: 50px;
    }
    .absolute{
        position: absolute;
        width: 200px;
        height: 100px;
        border: 1px solid blue;

        top: 20px;
        left: 50px;
    }
</style>
<body>
<p>定位演示</p>
<div class="relative">
    <div class="absolute">
        absolute
    </div>
</div>
</body>
</html>